import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;

public class SwingRender extends JFrame {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;

	private JMenu jMenu = null;

	private JMenuItem jMenuItemRun = null;

	private JMenuItem jMenuItemExit = null;

	private JMenuBar jMenuBar = null;

	/**
	 * This method initializes jMenu	
	 * 	
	 * @return javax.swing.JMenu	
	 */
	private JMenu getJMenu() {
		if (jMenu == null) {
			jMenu = new JMenu("File");
			jMenu.add(getJMenuItemRun());
			jMenu.add(getJMenuItemExit());
		}
		return jMenu;
	}

	/**
	 * This method initializes jMenuItemRun	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
	private JMenuItem getJMenuItemRun() {
		if (jMenuItemRun == null) {
			jMenuItemRun = new JMenuItem("Run");
		}
		return jMenuItemRun;
	}

	/**
	 * This method initializes jMenuItemExit	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
	private JMenuItem getJMenuItemExit() {
		if (jMenuItemExit == null) {
			jMenuItemExit = new JMenuItem("Exit");
		}
		jMenuItemExit.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				System.exit(0);
			}
             
		});// Ends method
		
		return jMenuItemExit;
	}

	/**
	 * This method initializes jJMenuBar	
	 * 	
	 * @return javax.swing.JMenuBar	
	 */
	private JMenuBar getjMenuBar() {
		if (jMenuBar == null) {
			jMenuBar = new JMenuBar();
		}
		return jMenuBar;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				SwingRender thisClass = new SwingRender();
				thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				thisClass.getJMenuBar().add(thisClass.getJMenu());
				thisClass.setVisible(true);
			}
		});
	}

	/**
	 * This is the default constructor
	 */
	public SwingRender() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(400, 200);
		this.setJMenuBar(getjMenuBar());
		this.setContentPane(getJContentPane());
		this.setTitle("Stereo Vision");
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.add(getJMenu(), BorderLayout.NORTH);
		}
		return jContentPane;
	}

}
